package io;

import com.sun.deploy.security.SandboxSecurity;

import java.io.*;
import java.lang.reflect.Array;
import java.nio.charset.StandardCharsets;

public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("doc.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);

        String line = "二百多斤英国大力士";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        bos.write(data);
        bos.flush();
        System.out.println("输出完毕");
        bos.close();
    }
}
